Method and Apparatus for Encoding and Decoding Subband Decompositions of Signals

ABSTRACT

An aspect of the present invention includes a method of encoding coefficients of a subband decomposition, to prepare the coefficients for compression. Another aspect of the present invention includes an inverse method of decoding coefficients of a subband decomposition, after they have been decompressed. Particular features and other aspects of the present invention are indicated in the specification, including the drawings and claims.

PRIORITY INFORMATION

This application is a continuation of application Ser. No. 11/440,587,filed 25 May 2006, entitled “Method and Apparatus for Encoding andDecoding Subband Decompositions of Signals,” issuing as U.S. Pat. No.7,346,218 on 18 Mar. 2008, which is a continuation of application Ser.No. 10/924,322, filed 23 Aug. 2004, entitled “Method and Apparatus forEncoding and Decoding Subband Decompositions of Signals,” issuing asU.S. Pat. No. 7,054,498 on 30 May 2006, which is a continuation ofapplication Ser. No. 09/833,803, filed 12 Apr. 2001, entitled “Methodand Apparatus for Encoding and Decoding Subband Decompositions ofSignals,” which issued as U.S. Pat. No. 6,782,136 on 24 Aug. 2004.

BACKGROUND OF THE INVENTION

Subband decompositions efficiently represent a wide range of signals informs suitable for compression. The encoded representations of thesedecompositions may be lossless or lossey. The efficiency of compressiondepends on reordering and transforming the representation ofcoefficients, which may decrease the number of bits to be compressed andshould organize the bits to be compressed in an order that enhances theeffect of compression. One subband decomposition that has become favoredis a discrete wavelet transform. Work has been done, but much remains tobe done on efficiently transforming a subband decomposition to prepareit for compression.

Therefore, there is an opportunity for inventions which prepare subbanddecompositions for compression, which include both methods and inversemethods of operating on decompositions and data structures well adaptedto preparing subband decompositions for compression.

SUMMARY OF THE INVENTION

An aspect of the present invention includes a method of encodingcoefficients of a subband decomposition, to prepare the coefficients forcompression. Another aspect of the present invention includes an inversemethod of decoding coefficients of a subband decomposition, after theyhave been decompressed. Particular features and other aspects of thepresent invention are indicated in the specification, including thedrawings and claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a general-purpose computer that may be usedto practice aspects of the present invention.

FIG. 2 is a block diagram of one hierarchical structure of a subbanddecomposition.

FIGS. 3A and 3B illustrate the operation of a type of waveletdecomposition on a circle.

FIGS. 4A, 4B and 4C illustrate the operation of a type of waveletdecomposition on a portrait of Albert Einstein.

FIG. 5 illustrates a simplified data structure including coefficients,parent-child relationships among the coefficients, A-tree leading zerosvalue and B-tree leading zeros value.

FIGS. 6A-6E illustrate one encoding scheme that practices aspects of thepresent invention.

FIGS. 7A-7K illustrate one decoding scheme that practices aspects of thepresent invention.

DETAILED DESCRIPTION

The following detailed description is made with reference to thefigures. Preferred embodiments are described to illustrate the presentinvention, not to limit its scope, which is defined by the claims. Thoseof ordinary skill in the art will recognize a variety of equivalentvariations on the description that follows.

FIG. 1 depicts general-purpose computer 100 which may be used topractice aspects in the present invention. The computer includes a CPU102, which can read from a read only memory 104, which can read from andwrite to a random access memory 106, which can read from or write to adisk storage system 108, which can communicate across a networkconnection 112, and which can receive and send data via input outputports 110. Programs and routines may be stored on the disk storage 108,either a fixed or removable disk, be read into random access memory 106and be executed on the CPU 102. The output of a routine running on theCPU may be input to a subsequent routine. The output of a routine may bedata stored in random access memory, data stored on the disk storagesystem, data communicated via network connection, or data communicatedacross the output port. Similarly, the output of one part of a routinerunning on the CPU may be input to a subsequent part of same routine.

FIG. 2 depicts the hierarchical or parent-child relationship amongsubbands of a subband decomposition. A subband decomposition is appliedto a signal. Signals of typical interest include a still photo, asegment of audio, or a segment of video. Other signals include 3D voxeldata, which is used for medical data like MRI's, and 3D polygonal meshdata (i.e. defining a 3D surface as a bunch of polygons). Thesecategories are often further refined in accordance with signalprocessing requirements. For instance, nature photography may bedistinguished from satellite photography, where low-frequency featuresof nature photography are most interest, while high frequency featuresof satellite photography are most interest. A wide variety of subbanddecomposition techniques have been developed, including liftingfunctions and families of discrete wavelet transforms. A broad view ofsubband decompositions includes discrete cosine transforms, which itbeen adopted for JPEG, MPEG and HDTV standards. Reviews of subbanddecompositions can be found in Kolarov et al., U.S. Pat. No. 6,144,733,“Wavelet-Based Data Compression” (issued Nov. 7, 2000) and Ferriere,U.S. Pat. No. 5,880,856, “Progressive Image Transmission Using DiscreteWavelet Transforms” (issued Mar. 9, 1999). Additional referencespotentially of interest include: R. Algazi and R. R. Estes, “Analysisbased coding of image transform and subband coefficients” inApplications of Digital Image Processing XVII, volume 2564 of Proc. ofthe SPIE, pages 11-21, 1995; H Klock, A Polzer, and J Buhmann,“Region-Based Motion Compensated 3D-Wavelet Transform Coding of Video”,in IEEE Conference on Image Processing, Oct. 26-29 1997, Santa Barbara;R. Kronland-Martinet, J. Morlet, and A. Grossman, “Analysis of SoundPatterns through Wavelet Transforms” Technical Report, Centre dePhysique Theorique, 1987; and M. Unser and A. Aldroub, “A review ofwavelets in biomedical applications” Proceedings of the IEEE, 84(4), pp.626-638, 1996. Books addressing the wavelet and DCT decompositionsinclude Pankaj N. Topiwala, ed., “Wavelet Image and Video Compression,”Kluwer Academic Publishers (1998) and K. R. Rao, P. Yip, “DiscreteCosine Transform: Algorithms, Advantages, Applications,” Academic PressInc. (1998).

In the two level hierarchical decomposition of FIGS. 2A and 2B, a signal200, for instance, a gray-scaled photograph, is represented by a squaregrid. A spatial orientation tree is defined in a pyramid that isconstructed with recursive four-subband splitting. In the first level ofdecomposition, the image is separated into four subbands, including 214,215 and 216, and an upper left quadrant. In the second leveldecomposition, the upper left quadrant is again separated into foursubbands, including 210, 211, 212 and 213. In subband 210, the so-calledlowpass subband, six pixels are depicted. In the subbands 211, 212 and213, three pixels are depicted. In the subbands 214, 215 and 216, groupsof four pixels are depicted. A coefficient is assigned to a pixel 221,for instance, corresponding to its gray scale value. Arrows lead fromparent coefficients to child coefficients. In this particular treeorganization, the upper left most coefficient (not numbered) is the rootof the tree. The coefficient 221 in subband 210 has three children, oneeach in subband 211, 212 and 213. Coefficients in the upper left cornerof subband 210 also have four children within subband 210. Coefficientsin other subbands have groups of four children. Coefficient 221 in FIG.2A has seven children coefficients, one in each of the subbands 211, 212and 213 and a group of four in subband 210. Coefficient 222 in FIG. 2Bhas three children coefficients, one in each of the subbands 211, 212and 213. Coefficients 223, 224 and 225 each has a group of four childrencoefficients, in subbands 214, 215 and 216, respectively. Whencoefficients in each subband of this grid are numbered with 0, 0 as theupper left most coefficient in the subband and all coefficients aregiven positive indices, general rules regarding the location of acoefficient's parent can be stated as follows:

For subband 210, coefficient (x, y) has its parent at (floor(x/2),floor(y/2)), in subband 210, where the floor( ) function is the integerpart of the (operation).

For subbands 211, 212 and 213, coefficient (x, y) has its parent at(floor(x/2), floor(y/2)), in subband 210.

For subbands beyond 213 (in this two level decomposition case, subbands214, 215 and 216), coefficient (x, y) of subband(i) has its parent at(floor(x/2), floor(y/2)), in subband(i-3) (in this case, subbands211-213.)

More generally, various signals, signal sampling and tree structures canbe used with the present invention. For different types of signals,coefficients may relate to samples other than pixels. A sound signal maybe decomposed into amplitudes in different wavebands, instead of pixels.Other types of trees can be used. For images, Shapiro, J. M., “EmbeddedImage coding Using Zerotrees of Wavelet Coefficients”; IEEE Transactionson Signal Processing; vol. 41, No. 12, December 1993; pp. 3445-3462; andPearlman, et al., U.S. Pat. No. 5,764,807 depict other tree structuresthat are compatible with aspects of the present invention.

FIGS. 3A and 3B are an original image and a two-level subbanddecomposition, using a discrete wavelet transform. The original image inFIG. 3A is a white circle on a black background. Because the figure isof limited resolution, e.g. 256 by 256 pixels, the dividing line betweenwhite and black may appear slightly jagged. There are many differentdiscrete wavelet transforms that can be applied to decompose theoriginal image. One discrete wavelet transform divides an image in foursubbands using filters including a low pass or averaging filter, avertical edge detection filter, a horizontal edge detection filter and adiagonal edge detection filter. FIG. 3B depicts two applications of sucha discrete wavelet transform. The low pass, after two decompositions is310. The vertical edge filter in the first pass produces 314. Thehorizontal and diagonal edge filters in the first pass produce 315 and316, respectively. In the second pass, the vertical, horizontal anddiagonal edge filters produce results in 311, 312 and 313, respectively.One property of this discrete wavelet transform is that the result isthe same size, data-wise, as the original image.

One set of filters that are efficient to implement are the ⅗biorthogonal wavelet transform of Cohen-Daubechies-Feauveau (A. Cohen,I. Daubechies, and J. Feauveau, “Bi-orthogonal Bases of CompactlySupported Wavelets”; Comm Pure. Appl. Math., vol. 45, pp. 485-560;1992). For analysis of the image into the pyramid, the filter [−½1−½] isused for the highpass and [−⅛−¼¾−¼−⅛] for the lowpass. For synthesis ofthe pyramid back to an image, the filter [½ 1½] is used for the lowpassand [−⅛−¼ ¾−¼−⅛] is used for the highpass. There are numerous wavelettransforms that are appropriate for different image characteristics orless frequency aliasing at the cost of larger impulse responses (A.Aldroubi and M. Unser. “Families of Multiresolution and Wavelet Spaceswith Optimal Properties”; Numer. Funct. Anal. Optim., 14:417-446;1993.). There are also non-linear wavelet-like transforms appropriatefor lossless analysis (M. D. Adams and F. Kossentini, “ReversibleInteger-to-Integer Wavelet Transforms for Image Compression: PerformanceEvaluation and Analysis”; IEEE Trans. Image Proc. vol. 9 pp. 1010-1024;2000).

FIGS. 4A through 4C apply a three-level discrete wavelet transform togenerate a subband decomposition of a portrait of Albert Einstein. Theoriginal image in FIG. 4A is an eight-bit, 256 gray level stillphotograph 256 by 256 pixels. The three-level decomposition appears inFIG. 4B. To highlight the information content of the decomposition, thesubbands other than the low pass subband in the upper left most quarterare reversed in FIG. 4C. Application of these subband decomposition isfully reversible, to produce an image with the same details the originalimage. These decompositions typically are performed in order to createdata structures that can readily be reordered for effective compressionby methods such as adaptive arithmetic encoding or run length encoding.Sometimes, these decompositions are performed in order to isolatefeatures of the original signal that are of greatest interest.

FIGS. 5 through 7 illustrate encoding and decoding aspects of thepresent invention. FIG. 5 depicts the format used in FIGS. 6 and 7.Adjacent to the nodes of FIG. 5, there are two to four positions fordata. A coefficient is present at the center of the node. Thiscoefficient, for instance, may represent an eight-bit gray scale valuefrom a portrait of Albert Einstein. Adjacent to the coefficients are oneto three additional values labeled Z, A and B. The “Z” value is thenumber of leading zeros in the binary version of the coefficients. Eachcoefficient has a Z value. The “A” value may be referred to as theA-tree leading zeros value. Coefficients that have children (1.1 and1.2) have A values. The “B” value may be referred to as the B-treeleading zeros value. Coefficients that have grandchildren (1) have Bvalues. For a particular coefficient, the A-tree of that coefficient'sparent includes all the children coefficients, grandchildrencoefficients, and later generation descendants of that parentcoefficient, but not the parent coefficient itself. For a particularcoefficient, the B-tree of that coefficient's grandparent includes itsgrandchildren coefficients and later generation descendants of thatgrandparent coefficient, but not the grandparent coefficient itself, andnot any of the parent coefficients which are children of thegrandparent. A coefficient has no “A” value if it has no children; acoefficient has no “B” value if it has no grandchildren. The A-treeleading zeros value is the minimum number of leading binary zerospresent in any of the coefficients of the A-tree. Similarly, the B-treeleading zeros value is the minimum number of leading binary zerospresent in any of the coefficients of the B-tree. Calculation of thesevalues will become apparent in FIGS. 6A through 6E. The nodes in FIG. 5are hierarchically numbered. At the top of the tree is node 1. In theleft-hand child position is node 1.1. In the left most grandchildposition is node 1.1.1. This numbering convention will be used inreferring to FIGS. 6 and 7, although node numbers have been omitted fromthe subsequent figures, to reduce visual clutter.

FIGS. 6A through 6E are an example of preparing data for compression,including translating for output coefficients received in a data stream.This example is too simple to correspond to a subband decomposition of asignal, but it illustrates a method. This example has been simplified byselecting coefficients such that all of the calculations performedresult in positive coefficients. In practice, some coefficients arenegative. One technique for dealing with negative numbers is to capturethe magnitude of the coefficient and append a sign bit, if necessary.Another technique is to use a ones-complement or twos-complement stringrepresenting the negative number. Any technique of representing negativenumbers that is compatible with the compression scheme used, afterpreparing the data for compression, can be applied to the methods anddevices of the present invention.

The initial coefficient values of this example are represented indecimal form in FIG. 6A. At node 1, the value is 9; at 1.1, the value is5 and at 1.1.1, the value is 0. FIG. 6B depicts these initial values asfive-bit binary numbers. Five-bit binary numbers represent 32 possiblecoefficient values, 0 to 31.

FIG. 6C adds a decimal count of leading zeros for each of thecoefficients in the tree. The leading zero value of coefficient 1 is 1;of 1.1 is 2; and of 1.1.1 is 5. This is used to calculate variousfunctions of the A-tree and B-tree leading zeros value.

In FIG. 6D, the A-tree leading zeros value are added, in decimal, toeach of the coefficients that have children coefficients. That is,A-tree leading zeros value are added to 1, 1.1, and 1.2, but not tocoefficients at the lowest level of the tree, because those coefficientsdo not have children. At the top of the tree, the A-tree leading zerovalue is the least number of leading zeros in any of its childrencoefficients or their descendants, which collectively are the nodesbelow the top of the tree. Scanning those nodes, the least zero valuecalculated in FIG. 6C for any node below the top of the tree is 2. Thus,the A-tree leading zero value for the top node is 2. For nodes 1.1 and1.2, the A-tree values are 4 and 3, respectively. Note that the A-treevalue of the grandparent coefficient 1 is always less than or equal tothe A-tree value of the parent coefficients 1.1 or 1.2, which are thenext level down in the tree. This is helpful in understanding a methodof preparing A-tree leading zeros value in a single pass through asuitable data structure.

FIG. 6E adds the B-tree leading zeros value for the top node 1 of thistree, which is the only coefficient in the tree that has grandchildrencoefficients. The B-tree leading zeros value is the least number ofleading zeros found among the grandchildren coefficients of the subjectcoefficient or any of the decedents of those grandchildren coefficients.The B-tree leading zeros value is always greater than or equal to theA-tree leading zeros value associated with a coefficient. In FIG. 6E,node 1 has a B-tree leading zeros value of 3. Note that this is equal tothe least A-tree value of the child coefficients 1.1 or 1.2.

Continuing from FIG. 6E, an encoding that practices aspects of thepresent invention proceeds as follows. The encoding program receivesdata corresponding to a subband decomposition of a signal. This dataincludes coefficients, parent-child relationships among thecoefficients, A-tree leading zeros value associated with thecoefficients, and B-tree leading zeros value associated with thecoefficients. Encoding proceeds by walking the tree, so that parentcoefficients are visited before their children coefficients. Theencoding illustrated here utilizes a breadth first tree walk, so thatcoefficients 1.1 and 1.2 are encoded before coefficient 1.1.1.

In general, when the walk reaches a particular coefficient, if thecoefficient has a grandparent and the grandparent's B-tree leading zerovalue has not been translated for output, it is translated. A knottranslation can be used. In this translation, a value is generallyindicated by like quantity of zeros preceding a 1. For instance, thevalue zero is indicated by “1”B. The value 5 is indicated by “000001”B.One improvement on this knot translation is that a value equal to thelargest allowed value is indicated by a string of zeros, without afollowing one. For example, if the value six is the largest possiblevalue for a B-tree leading zeros value, then the value six can beindicated by “000000”B. Other translations than the knot translation canbe applied consistent with the present invention. Continuing with themethod in general, a function of the grandparent's B-tree leading zerovalue and its A-tree leading zero value can be translated, because thegrandparent's B-tree leading zero value is guaranteed to be greater thanor equal to the grandparent's A-tree leading zero value. When thefunction applied is the A-tree leading zero value minus the B-treeleading zero value, the value subject to the knot translation is oftenrepresented by fewer bits.

While the tree walk is visiting the particular coefficient, if thecoefficient has a parent coefficient and the parent's A-tree leadingzero value has not been translated, it is translated. A function of theparent's A-tree leading zero value and the grandparent's B-tree leadingzero value can be translated, because the grandparent's B-tree leadingzero value is guaranteed to be greater than or equal to the parent'sA-tree leading zero value. When the function applied is the parent'sA-tree leading zero value minus the grandparent's B-tree leading zerovalue, the value translated by the knot translation is often representedby fewer bits.

The particular coefficient itself is also translated. The A-tree leadingzero value of the coefficient's parent coefficient is encoded in thismethod, so leading zeros in the coefficient equal to the parent's A-treeleading zero value are stripped away. One translation for the remainingbits, after removal of the specified number of leading zeros, is to usethe coefficient itself, with an appended sign bit. Other translationsmay be used. The translation for a coefficient may be different from thetranslations used for leading zeros value.

The translated values related to the coefficient can be output or queuedfor output.

The tree in FIG. 6E can be translated as follows:

coefficient 1: 01001;coefficient 1.1: 2, as 001; 101;coefficient 1.2: 110;coefficient 1.1.1: 3-2=1, as 01; 4-3=1, as 01; 0;coefficient 1.1.2: 1;coefficient 1.2.1: 3-3=0, as 1; 01; andcoefficient 1.2.2: 10.

Applying knot encoding, the fully translated string, with blanksinserted forreadabilityis 01001 001 101 110 01 01 0 1 1 01 10.

One encoding variation is to encode A-tree leading zero values andB-tree leading zero values, without using a function (e.g., A-tree minusB-tree) to reduce the magnitude of the values being encoded. Anothervariation is only to encode A-tree leading zero values and coefficientvalues (ignoring the B-tree leading zero values). This avoids a seconddereference to find the grandparent of the current coefficient, but at acost of up to 10% encoding quality. Another variation is to only encodeB-tree leading zero values and coefficient values, at the cost of up to50% encoding quality.

The encoding process previously described is entirely reversible. FIGS.7A-7K depict decoding of the string that we encoded above:

0100100110111001010110110.

The number of bitplanes in this example is 5. The structure of thecoefficients is depicted in FIG. 5. In practice, the number of bitplanesand the structure of the coefficients can either be known in advance ortransmitted as part of the data stream. This holds for both data streamsreceived by the encoder and the decoder.

FIG. 7A illustrates capturing the root coefficient in position 1. Theroot coefficient has no parent or grandparent coefficient. The number ofbits representing the root coefficient is the number of bitplanes thatwere encoded. Accordingly, the first five bits of the data, “01001”B arethe root coefficient.

FIG. 7B illustrates capturing the A-tree leading zeros value for theparent of the coefficient in position 1.1, which has a parent but nograndparent. At this point, the remaining string is“00110111001010110110”B. This leading zeros value is translated usingknot notation. Bits in the data string are read until either five zeroshave been encountered or a “1” has been encountered. The remaining,unprocessed data string begins with “001”B, which corresponds to anA-tree leading zeros value of 2. (As illustrated for FIG. 7F below, moreis involved when a coefficient has both a parent and a grandparentcoefficient. Here, because there is no grandparent coefficient, theB-tree leading zeros value of the grandparent coefficient is treated as0.)

FIG. 7C illustrates capturing the coefficient value for position 1.1. Atthis point, the remaining string is “10111001010110110”B. The A-treeleading zeros value of the parent coefficient is two and the number ofbitplanes is five, so coefficient 1.1 is expressed in three bits,“101”B. This string, with two leading zeros, is coefficient 1.1.

FIG. 7D illustrates capturing the coefficient value for position 1.2. Atthis point, the remaining string is “11001010110110”B. This coefficient,like the prior coefficient, does not have a grandparent, but does have aparent. The A-tree leading zeros value of the parent is 2. Because wehave 5 bitplanes, we read the next three bits, “100”B.

FIG. 7E illustrates capturing the B-tree leading zeros value of thegrandparent of the coefficient in position 1.1.1. At this point, theremaining string is “01010110110”B. This coefficient has both a parentand a grandparent. In this example the present invention, a function ofthe grandparent's A- and B-tree leading zeros values is next in the datastream. Using knot notation, we read the bits “01”B, which translates tothe value 1. The function used in this example is the grandparent'sA-tree leading zeros value minus the grandparent's B-tree leading zerosvalue. The value 1 is added to the grandparent's A-tree leading zerosvalue of 2. Thus, the grandparent's B-tree leading zeros value is 3.

FIG. 7F illustrates capturing the A-tree leading zeros value for theparent of the coefficient in position 1.1.1. At this point, theremaining string is “010110110”B. Using knot notation, the bits “01”Btranslate to the value 1. In this example, this value represents afunction of the B-tree leading zeros value of the grandparentcoefficient and the A-tree leading zeros value of the parentcoefficient. The value 1 is added to the grandparent's B-tree leadingzeros value of 3. Thus, the parent's A-tree leading zeros value is 4.

FIG. 7G illustrates capturing the coefficient in position 1.1.1. At thispoint, the remaining string is “0110110”B. The parent's A-tree leadingzeros value is 4 and the number of bitplanes is 5, so this coefficientis encoded by a single bit, which is “0”B. The coefficient is “00000”B.

FIG. 7H illustrates capturing the coefficient in position 1.1.2. At thispoint, the remaining string is “110110”B. This coefficient also isencoded by a single bit, which is “1”B. The coefficient is “00001”B.

FIG. 7I illustrates capturing the A-tree leading zeros value for theparent of the coefficient in position 1.2.1. At this point, theremaining string is “10110”B. Using knot notation, the bit “1”Btranslates to the value zero. Thus, the A-tree leading zeros value ofthe parent coefficient is the same as the B-tree leading zeros value ofthe grandparent coefficient, or 3.

FIG. 7J illustrates capturing the coefficient in position 1.2.1. At thispoint, the remaining string is “0110”B. The parent's A-tree leadingzeros value is 3, so this coefficient is captured in two bits. Thecoefficient is “00001”B.

FIG. 7K illustrates capturing the coefficient in position 1.2.2. At thispoint, the remaining string is “10”B. The parent's A-tree leading zerosvalue is 3, so this coefficient is captured in two bits, which matchesthe number of remaining bits. The coefficient is “00010”B. Thecoefficient values in FIG. 7K match the values in FIG. 6B. The full treein this figure matches FIG. 6E.

A data structure composed of a series of arrays allows efficientencoding and decoding of the A-tree, B-tree, and coefficient values. Asubband decomposition can be referred to as a pyramid of coefficients,given the parent-child relationships illustrated in FIGS. 2A-2B. A oneto one mapping from the integers [0, n-1] to the pyramid coefficients(where n is the number of coefficients) is defined such that a parentcoefficient is listed before any of its children. This effectivelyrepresents the pyramid in an array. Following this mapping, thefollowing arrays are used to associate information with the pyramidcoefficients:

-   -   pyr_elemArray: an array of pointers to the pyramid coefficients        (to facilitate decoding);    -   a_zerosArray: an array of integers representing the A-tree        values associated with the given coefficient;    -   b_zerosArray: an array of integers representing the B-tree        values associated with the given coefficient;    -   quant_magArray: an array of integers representing the quantized        magnitudes of the given coefficient;    -   attribArray: an array of integers whose individual bits        represent:        -   the signs of the given coefficient;        -   if the A-tree zero value has been sent/received for the            given coefficient;        -   if the B-tree zero value has been sent/received for the            given coefficient; and    -   parentArray: an array of integers whose value is the array index        representing the parent of the given coefficient.        Once populated, this array structure allows the pyramid of        coefficients to be encoded and decoded in a single pass.

Alternative data structures also are useful. In the embodiment above,pyr_elemArray could be an array of coefficients, instead of pointers tocoefficients. Any or all of the arrays could be practiced as a set ofarrays, for instance when a color signal is decomposed in a RGB, CYMK orLAB color space or a sound signal is decomposed in to high, treble andbass channels. Separate arrays can be maintained for different signalchannels, different subbands or both. A group of subband arraysprocessed in an order equivalent to processing a single array is certainequivalent to concatenating the subband arrays into a single array.

The data structures of this invention are useful if they include fewerthan all of the arrays listed above. For instance, an array ofcoefficients (or pointers to coefficients) and parallel A-tree andB-tree zero value arrays, without any further arrays, would be useful.Adding to this combination a parentArray identifying the parentcoefficients, either by pointer or by array index, would be useful.Adding a quant_magArray for quantized coefficients would be furtheruseful.

Some data structures useful in practicing aspects of the presentinvention break sharply from the teachings of Said et al., ImageCompression Using the Spatial-Orientation Tree, May 1993, pp. 279-282;Said, A. & Pearlman, W. A., “Image Compression Using theSpatial-Orientation Tree,” IEEE Int. Symp. on Circuits and Systems, vol.1, May 1993, pp. 279-282; and Shapiro, J. M., “Embedded Image codingUsing Zerotrees of Wavelet Coefficients”; IEEE Transactions on SignalProcessing; vol. 41, No. 12, December 1993; pp. 3445-3462. A patentissued on work by Pearlman, et al., U.S. Pat. No. 5,764,807, summarizesthe data structure created as “a list of insignificant sets of points .. . , wherein each set of the LIS is designated by a root node withinthe subband decomposition and has a corresponding tree structure ofpoints within the subband decomposition. The tree structure is organizedas points comprising descendants and offspring of the root node, whereina first generation of the descendants comprises the off-spring.” Thislist of insignificant points structure facilitated progressive encodingof embedded images, one bit plane at a time. Progressively encodedimages, when decoded, appear on a user's screen as a fuzzy image whichgains resolution, instead of popping full-formed into view.

The data structures of the present invention facilitate non-progressiveencoding, and could be used with progressive encoding as well.

Another aspect of the present invention is a method of calculatingA-tree leading zero values and B-tree leading zero values in a singlepass through a plurality of arrays holding coefficients and associatedvalues. This method may begin with receiving data corresponding to asubband decomposition of a signal, including coefficients andparent-child relationships among the coefficients. As described above,the signal can be virtually any type of digital signal; the examples inthe figures depict a grey-scale photograph, but many other types ofsignal can be processed in the same fashion. A signal is represented bycoefficients. Parent-child relationships are defined among thecoefficients.

The data corresponding to the subband decomposition of a signal may beaccompanied by data describing the dimensions of the pre-decompositionsignal. It may further include the number of levels of decomposition. Italso may include a count of the number of levels of decompositionapplied to the signal. The channels of the signal, such as RGB, CYMK orLAB or high, treble and bass can be identified in the data. The data maybe organized so that the parent-child relationships among subbanddecomposition coefficients are implicit in the organization, whether ornot the data includes dimensions of the pre-decomposition signal.Alternatively, there may be explicit links between parents and children.

The calculation method proceeds by visiting the coefficients, childrencoefficients before their parent coefficients. For instance, if an arrayholds all of the coefficients, parents before children, the array couldbe processed from end to beginning or if it holds children beforeparents, it could be processed from beginning to end. A tree structurewould be walked beginning at the bottom.

References pointing to parent and grandparent coefficients can beassembled in the same pass that the leading zero values are calculated,in an earlier pass, or by using a template data structure adapted to thedimensions of the signal. The references to parent and grandparentcoefficients can be separate or grandparent coefficients can be reachedthrough parent coefficients. The references can be pointers, arrayindexes or any other suitable data identifying the ancestorcoefficients.

As the coefficients are visited, a B-tree leading zero value iscalculated and stored with a grandparent coefficient of the coefficientvisited, if the coefficient visited has a grandparent. A B-tree leadingzero value for a grandparent of the visited coefficient can becalculated as the lesser of (i) a number of leading zeros in the visitedcoefficient or (ii) an A-tree leading zeros value associated with thevisited coefficient, if the visited coefficient has childrencoefficients, or (iii) the B-tree leading zero value previouslyassociated with the grandparent coefficient. The calculation of a B-treeleading zero value for a particular grandparent coefficient is a processof accumulation. Several coefficients are visited which are descendentsof the same grandparent coefficient. Each time one of the grandchildrenis visited, the B-tree leading zero value stays the same or decreases.

Similarly, as the coefficients are visited, an A-tree leading zero valueis calculated and stored with a parent coefficient of the coefficientvisited, if the coefficient visited has a parent. An A-tree leading zerovalue for a parent of the visited coefficient can be calculated as thelesser of (i) a number of leading zeros in the visited coefficient or(ii) an A-tree leading zeros value associated with the visitedcoefficient, if the visited coefficient has children coefficients, or(iii) the A-tree leading zero value previously associated with theparent coefficient. The calculation of an A-tree leading zero value fora particular parent coefficient is a process of accumulation. Severalcoefficients are visited which are descendents of the same parentcoefficient. Each time one of the children is visited, the A-treeleading zero value stays the same or decreases.

The B-tree and A-tree leading zero values can be stored in memory oroutput. The memory may be a random access, disk, non-volatile or othermemory, including memory for another process or logic segment to use.The output may be to magnetic media for storage or to another process orlogic segment to use.

Encoding data for compression is a further aspect of the presentinvention. Encoding may begin with receiving data corresponding to asubband decomposition of a signal, including coefficients, parent-childrelationships among the coefficients, A-tree leading zeros valuesassociated with the coefficients, and B-tree leading zeros valuesassociated with the coefficients. For instance, the output of theprocess describe above could be the input to this process. Other formsof expressing the relationships among the coefficients and ofcalculating the A-tree and B-tree leading zeros values may equally wellbe the starting point for this process. The received data also mayinclude dimensions of the pre-decomposition signal. Parent-childrelationships among the coefficients may be implicit in the organizationof the received data. Alternatively, the data may include explicitlinks, either from parents to children or vice-versa.

The method proceeds with visiting the coefficients, parent coefficientsbefore their children coefficients. If the coefficients are stored in anarray, parents before children, the method could begin at the start ofthe array. For the visited coefficients, the following translations maytake place. (a) If the visited coefficient has any grandparentcoefficient and the grandparent coefficient has not previously beentranslated, the first translation may be a function of the grandparent'sA-tree and the B-tree leading zeros values. For instance, the differenceof the B-tree minus the A-tree leading zeros values may be small, andalways will be non-negative. (b) If the visited coefficient has anyparent coefficient and the parent coefficient has not previously beentranslated, translating a function of the A-tree leading zero valueassociated with a parent coefficient of the visited coefficient and ofthe B-tree leading zero value associated with the grandparentcoefficient of the visited coefficient, wherein the B-tree leading zerovalue associated with the grandparent coefficient is assigned apredetermined value if the visited coefficient does not have anygrandparent coefficient. The function, for instance, may be thedifference of the A-tree leading zeros value of the parent minus theB-tree leading zeros value of the grandparent coefficient. Thisdifference may be small and always will be non-negative. These stepscould be performed in the order (a)-(b) or vice-versa. Translating in(a) & (b) may need to be done only once for each grandparent node. A bitflag or equivalent structure may be used to account for whether aparticular node has been translated yet, in one way and another.Alternatively, a rule may be adopted based on knowledge of the treestructure, so that the (a) or (b) translating step is carried out for agrandparent or parent coefficient on the first, last or other occasionthat it is accessed. One potential translation of the functions (a) &(b) is using knot encoding, as described above. The (a), (b) and visitedcoefficient translations need not use the same translation. Inparticular, the (a) & (b) translations may use a first translation andthe translating the visited coefficient step may use a second, differenttranslation.

While still at the visited coefficient, the method may includetranslating at least part of the visited coefficient starting in a nextplace of the visited coefficient, if any, beyond a place indicated bythe A-tree leading zero value of the parent coefficient, if the parentcoefficient exists, or in a first place of the visited coefficient ifthe parent coefficient does not exist. Equivalent to this handling ofcoefficients without parents is creating a root which has no coefficientvalue and setting a special coding rule for the root, such as the rootdoes not need to be coded because no value is assigned to it and becauseit does not have any parent or grandparent. Parts of a coefficientbeyond the leading zeros indicated by the A-tree leading zero value ofthe parent coefficient may suitable be translated as themselves. Thatis, for a leading zeros value of 3, the string 00001111 may betranslated as 01111. Other translations also may be used, or they may bepart of a compression process, which utilizes output from thetranslations associated with the visited coefficient.

The output of these translations may include storing translated valuesin memory locations accessible to a subsequent process. Those memorylocations may be random access memory, disk memory, non-volatile memoryor any other suitable memory structure.

The method further may include compressing the outputted values. Thecompression suitably may be Huffman encoding, arithmetic encoding,adaptive arithmetic encoding, run length encoding or any suitablecompression algorithm.

Depending on the structure of the pyramid of nodes, that is, the treestructure, the visiting of parent coefficients before their children maybe implemented in a variety of equivalent ways. The visiting may becarried out beginning with a subband that includes a root node or havingat least one coefficient that has no parent coefficient. Then, data forthe subbands may be processed in scan line order. Alternatively, if thedata includes a root node having no coefficient, the visiting may becarried out beginning with the root node and proceeding as a preordertree walk. If the data includes a plurality of coefficients having noparent coefficients, then the visiting may proceed as a plurality ofpreorder tree walks, either in parallel or one after the next, startingat each of the coefficients having no parent coefficients.

Fewer than all of the bits of a coefficient may be translated. Forinstance, the coefficient may be quantized before or as a part oftranslation. Or, some or all of the coefficients of the decompositionmay represented by fewer bits than available from the decomposition. Apredetermined number of low order bits may be dropped. Differentpatterns of bit dropping may be applied to different channels.

A further aspect of the present invention is a method of decoding datathat has been encoded in accordance with the present invention. Those ofskill in the art will be able to practice the inverse or decodingprocess, from the encoding described above. In general terms, one aspectof the present invention populates a data structure based on dataderived from a subband decomposition. The data structure may includecoefficients, A-tree and B-tree leading zeros values and a structure(implicit or explicit) corresponding to parent-child relationships amongthe coefficients. The method may begin with receiving data derived froma subband decomposition of a signal. Typically, the data will bedecompressed. Alternatively, a data decompression step may precede otherdecoding steps. Working with the data structure, the method proceedswith visiting coefficients in the data structure, parent coefficientsbefore child coefficients and parsing one or more substrings from thedata corresponding to the visited coefficient. For a visited coefficientthat has a grandparent coefficient, translate a first substring into afunction (a) of the A-tree leading zero value and the B-tree leadingzero value both associated with a grandparent coefficient of the visitedcoefficient, calculating a B-tree leading zero value of the grandparentcoefficient, and associating the B-tree leading zero value with thegrandparent coefficient. The function (a) may be the difference of theA-tree minus the B-tree leading or any other suitable function. Further,for a visited coefficient that has a parent coefficient, translate asecond substring into a function (b) of the A-tree leading zero valueassociated with the parent coefficient of the visited coefficient and ofthe B-tree leading zero value associated with the grandparentcoefficient of the visited coefficient, where the B-tree leading zerovalue associated with the grandparent coefficient is assigned apredetermined value if the visited coefficient does not have anygrandparent coefficient. The predetermined value may be zero. Thefunction may be the difference of the A-tree minus the B-tree leadingzeros value or any other suitable function. The A-tree leading zerovalue of the parent coefficient may be calculated using, if needed thefunction (a) & (b) results. The A-tree leading zeros value is thenassociated with the parent coefficient. This association may involvestoring the value in a memory location. Depending on the encoding, thefunction (a) value may precede or follow the function (b) value in thedata stream. Decoding should be adapted to the encoding actually used.This method further includes translating a substring corresponding tothe visited coefficient, utilizing the A-tree leading zero value of theparent coefficient, if any, to determine the number of leading zeros ofthe visited coefficient, and associating the coefficient value with thevisited coefficient.

This method of decoding may, implicitly or explicitly, accommodatenegative coefficients. As described above, negative coefficients may berepresented by their magnitude and a sign bit. The data decoded mayinclude dimensions of the signal being decoded. It further may includeinformation regarding the form of encoding, including the number oflevels of decomposition, the number of bits encoded, and the like. Thenumber of bits encoded may vary by subband, location within the field ofthe signal or other parameters. Based on information regarding thesignal being decoded, this process may further include initializing adata structure to receive the coefficients. Initializing the datastructure may include setting links to parent or grandparentcoefficients, as by calculating array indexes or initializing pointers.For a signal of common dimensions, a template data structure withpresent links may be used.

While the preceding examples are cast in terms of a method, devices andsystems employing this method are easily understood. A magnetic memorycontaining a program capable of practicing the claimed method is onesuch device. A computer system having memory loaded with a programpracticing the claimed method is another such device.

While the present invention is disclosed by reference to the preferredembodiments and examples detailed above, it is understood that theseexamples are intended in an illustrative rather than in a limitingsense. It is contemplated that modifications and combinations willreadily occur to those skilled in the art, which modifications andcombinations will be within the spirit of the invention and the scope ofthe following claims.

1. A method of efficiently decoding a signal, including: receiving azero tree encoded signal; decoding the zero tree encoded signal,including reconstructing at least one of an A-tree or a B-tree ofleading zero values for a pyramid of coefficients having parent andchild relationships, wherein parent nodes in the A-tree indicate aminimum number of leading zeros for coefficients at children nodes anddescendants of the children nodes and wherein grandparent nodes in theB-tree indicate a minimum number of leading zeros for coefficients atgrandchildren nodes and descendants of the grandchildren nodes; andreconstructing an original signal from the A-tree and/or B-tree of zerovalues and coefficients; and outputting or storing to memory thereconstructed original signal.
 2. A method of efficiently encoding andsending a signal, including: receiving and encoding an original signalto a zero tree encoded signal, including constructing at least one of anA-tree or a B-tree of leading zero values for a pyramid of coefficientshaving parent and child relationships, wherein parent nodes in theA-tree indicate a minimum number of leading zeros for coefficients atchildren nodes and descendants of the children nodes and whereingrandparent nodes in the B-tree indicate a minimum number of leadingzeros for coefficients at grandchildren nodes and descendants of thegrandchildren nodes; and walking the A-tree and/or B-tree to construct astream including zero values and coefficients; and outputting or storingto memory the encoded signal.